<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover"/>
    <meta http-Equiv="Cache-Control" Content="no-cache"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta http-Equiv="Pragma" Content="no-cache"/>
    <meta http-Equiv="Expires" Content="0"/>
</head>
<style>
    [v-cloak] {
        display: none;
    }
    html, body { margin: 0; padding: 0;}
    #app { max-width: 640px; margin: 0 auto; overflow: hidden; height: 100%; }
</style>
<body>

<div id="app" v-cloak>
    <!--childView是固定值-->
    <component v-bind:is="childView">
    </component>
</div>
</body>
<!--引用 vue-rap文件-->
<script src="../rap.1.3.2.js"></script>

<script>
    //代码写在onload里防止阻塞页面渲染
    window.onload = function () {
        Rap.config({
            debug: true,
            default_page: "mobile/list",//默认首页
            app_version: '14',//应用版本
            comp_version: {'test_page6': 1},
            css: [//加载css文件
                'bootstrap.3.3.7.min.css',
            ],
            filePostfix:'html',//默认后缀为 html
            script: [//加载js文件
                "vue.2.5.13.js",
                "vue-role.0.1.0.js"
            ],
            onPageLoadError:function (page,e) {
                //页面加载错误
                console.log('page'+page+e);
            }
        }).ready(function () {
            if (!Rap.debug) {
                //这里可以异步加载编译后的文件
                //return Rap.loadScript('rap-all.js');  //loadScript 返回的也是promise
            }
        }).then(function () {
            //这里也可以预加载模块
            return Rap.loadMod(['test/page3']);       //loadMod 返回的也是promise
        }).then(function () {
            window.APP = Rap.app({
                el: '#app'
            });
        });
    }
</script>

</html>